import { createRouter, createWebHistory } from 'vue-router'
import anime from '@/views/anime/index.vue'
import category from '@/views/category/index.vue'
import login from '@/views/login/index.vue'
import admin from '@/views/admin/index.vue'
import user from '@/views/user/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      component: login
    },
    {
      path: '/admin',
      component: admin,
      children: [
        {
          path: 'anime',
          component: anime
        },
        {
          path: 'category',
          component: category
        },
        {
          path: 'user',
          component: user
        }
      ]
    },
    {
      path: '/',
      redirect: '/login'
    }
  ]
})

export default router
